package com.jqr.activity.mycoroutine.api

import android.util.Log
import com.jqr.activity.mycoroutine.models.Articles

import okhttp3.OkHttpClient
import retrofit2.Call
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.GET
import retrofit2.http.Header


val  userServiceApi:UserServiceApi by lazy {

    val  retrofit=retrofit2.Retrofit.Builder()
        .client(OkHttpClient.Builder().addInterceptor {
            it.proceed(it.request().apply {


            })
        }.build())
        .baseUrl("http://10.0.2.2:8080/")
        .addConverterFactory(GsonConverterFactory.create())
        .build()
    retrofit.create(UserServiceApi::class.java)

}
interface UserServiceApi{
    @GET("article/list")
    fun  getArticles():Call<Articles>
    @GET("article/list")
    suspend  fun getAllArticles():Articles
}